#ifndef __SPI_H
#define __SPI_H

#include "public_lib.h"
#include "stm32f10x_spi.h"

typedef struct
{
    SPI_InitTypeDef cfg;
    SPI_TypeDef *instance;
    char user;
}s_spi_info;

int spi_init(int spi_id, s_spi_info *info);

u8 spi_readwrite(int spi_id, u8 data);

char get_spi_user(int spi_id);

#endif
